package entidades;

import java.sql.Date;
import java.sql.Time;
import java.util.Calendar;
import java.util.GregorianCalendar;
import java.util.Random;

/**
 * @author sg
 * @version 1.0
 * @created 13-nov-2013 06:33:11 p.m.
 */
public class Auditoria {

	private Date dia;
	private Time hora;
	private int id_aud;
	private Accion m_Accion;
	private int id_usuario;

	public Auditoria(){

	}

	public Auditoria(int id_usuario, String accion) {
		Random r = new Random();
		int valorDado = r.nextInt(999999999);
		this.id_aud=valorDado;
		this.id_usuario= id_usuario;
		Calendar c = new GregorianCalendar();
		this.hora = new Time(c.getTimeInMillis());
		this.dia = new Date(c.getTimeInMillis());
		this.m_Accion=new Accion(accion);
	}
	

	public Auditoria(Usuario user, Accion accion) {
		Random r = new Random();
		int valorDado = r.nextInt(999999999);
		id_aud=valorDado;
		this.m_Accion=accion;
		Calendar c = new GregorianCalendar();
		this.hora = new Time(c.getTimeInMillis());
		this.dia = new Date(c.getTimeInMillis());
		id_usuario=user.getId_usuario();
		
	}


	public Date getDia() {
		return dia;
	}

	public Time getHora() {
		return hora;
	}

	public int getId_aud() {
		return id_aud;
	}

	public Accion getM_Accion() {
		return m_Accion;
	}

	public int getId_usuario() {
		return id_usuario;
	}


	public void finalize() throws Throwable {

	}
}//end Auditoria